1. Field of the Invention
Apparatuses and methods consistent with the present invention relate to color interpolation, and more particularly, to interpolation using an interlaced Cyan, Magenta, Yellow, Green (CMYG) color format.
2. Description of the Related Art
Generally, a digital camera or camcorder uses a charge coupled device (CCD) or a complementary metal-oxide semiconductor (CMOS) instead of film. In the CCD, millions of light receiving elements are densely disposed and each light receiving element corresponds to one pixel and detects the luminance of an image being input. Since through the CCD only the luminance of light is detected, an image output from the CCD is not a color image recognized by a person but a black-and-white image. Accordingly, in order to obtain a color image from the image output of the CCD, a color filter is put on each pixel, a color value with respect to a predetermined color format is obtained, and a color image is obtained.
The color filters can be classified into primary color filters using Red, Green, Blue (RGB) color filters, including red, green, and blue, and complementary color filters using CMYG color filters, including cyan, magenta, yellow, and green. Since the CMYG color format has a better sensitivity of colors than that of the RGB color format, the CMYG color format is widely used as the color format of a camcorder.
Meanwhile, when one CCD device is used for one pixel, one pixel can store the color information of only one channel in color information of a plurality of channels. Though there are methods using a plurality of CCD devices for one pixel and storing color information of a plurality of channel complying with the RGB or CMYG color format, the CCD is an expensive device and therefore in many cases one CCD device is used for one pixel. When one CCD device is used for one pixel, in order to obtain information on a complete color image, color information of other channels not stored in pixels should be estimated (interpolated) from information on adjacent pixels.
FIG. 1 is a diagram briefly explaining a related art color interpolation process in a CMYG color format.
Referring to FIG. 1, in each pixel of a CCD 10, color information of cyan (hereinafter referred to as “Cy”), yellow (hereinafter referred to as “Ye”), magenta (hereinafter referred to as “Mg”), and green (hereinafter referred to as “G”), is stored, and an interlaced signal obtained by adding top pixels and bottom pixels is output as a final output. For example, in case of A1, (G+CY) and (Mg+Ye) are output as color values, and in case of A2, (Mg+Cy) and (G+Ye) are output as color values.
By calculating the (G+CY), (Mg+Ye), (Mg+Cy) and (G+Ye), the luminance (Y) and chrominance (R−Y, B−Y) can be obtained.
From the color information input in the top 2 rows (A1) of the CCD 10, Y and (R−Y) can be calculated as the following equations 1 and 2:
                    Y        =                                            {                                                (                                      G                    +                    Cy                                    )                                +                                  (                                      Mg                    +                    Ye                                    )                                            }                        ×                          1              2                                =                                    1              2                        ⁢                          {                              (                                                      2                    ⁢                    B                                    +                                      3                    ⁢                    G                                    +                                      2                    ⁢                    R                                                  )                            }                                                          (        1        )                                          R          -          Y                =                              {                                          (                                  Mg                  +                  Ye                                )                            -                              (                                  G                  +                  Cy                                )                                      }                    =                                    2              ⁢              R                        -            G                                              (        2        )            
In the same manner, from the color information input in the bottom two rows (A2) of the CCD 10, Y and (B−Y) can be calculated as the following equations 3 and 4:
                    Y        =                                            {                                                (                                      G                    +                    Ye                                    )                                +                                  (                                      Mg                    +                    Cy                                    )                                            }                        ×                          1              2                                =                                    1              2                        ⁢                          {                              (                                                      2                    ⁢                    B                                    +                                      3                    ⁢                    G                                    +                                      2                    ⁢                    R                                                  )                            }                                                          (        3        )                                          (                      B            -            Y                    )                =                                            {                              (                                  Mg                  +                  Cy                                )                            }                        -                          (                              G                +                Ye                            )                                =                                    2              ⁢              B                        -            G                                              (        4        )            
If Y, (R−Y), and (B−Y) are obtained through the equations 1 through 4, a color in the RGB or YCbCr format appropriate to output can be restored from the luminance and chrominance components by using simple linear conversion. Here, the chrominance signals (R−Y, B−Y) are sampled in the vertical direction twice as fast as the luminance signal (Y). Accordingly, separately from the luminance signal (Y), the chrominance signals (R−Y, B−Y) should be interpolated in the vertical direction.
In the color interpolation method according to the conventional technology, a pixel to be interpolated is formed as the sum or difference of two pixels extracted from CCD raw data, and therefore the interpolated pixel has a phase difference of about ½ pixel from the original image. This ½ pixel phase difference can be a problem when the edge is thin. Accordingly, in order to prevent this ½-pixel phase difference, the phase of an input signal and the phase of an output signal need to be identical.
Furthermore, in the color interpolation method according to the conventional technology, assuming that each pixel has statistically similar characteristics, interpolation is performed by using the sum and difference of four pixels. Accordingly, a serious error can occur on the boundary.
When (Cy+G) and (Ye+Mg) are included in different areas, (B−Y) and (R−Y) are calculated by using the equations 2 and 4, have a problem in that many lines are generated on the boundary. This problem is evenly spread to each color channel of an output signal RGB or YCbCr in a linear conversion process, and causes color noise and degradation in resolution.